<template>
    <van-nav-bar fixed 
    left-arrow title="登录" 
    right-text="注册" 
    @click-left="onClickLeft"
    @click-right="onClickRight">
    </van-nav-bar>
</template>
<script setup>
import {useRouter} from 'vue-router'
const router = useRouter()
// 左侧返回按钮
const onClickLeft = () => {
    console.log(1)
    if(history.state?.back){
        router.back()
    }else{
        router.push('/')
    }
}
// 右侧注册按钮
const onClickRight = () => {
    console.log(2)
}
</script>
<style lang='scss' scoped>
:deep() {
    .van-nav-bar {
        &__arrow {
            font-size: 18px;
            color: var(--cp-text1);
        }

        &__text {
            font-size: 15px;
        }
    }
}
</style>